jQuery(document).ready(function($) {
    $('body').append('<img style="visibility:hidden;" class="pinimgload" src="' + bs_pinButtonURL + '" >');
    $('#bs_pinOnHover').hide();
    var l;
    var m;
    var n;
    $('.pinimgload').load(function() {
        m = $('.pinimgload').outerWidth(true);
        n = $('.pinimgload').outerHeight(true);
        $('.pinimgload').remove()
    });
    var o = $('#bs_pinOnHover').html().indexOf("bloggersentral.com");
    o != -1 && hoverCheck();

    function hoverCheck() {
        $('.entry-content img,.post-body img,.entry-summary img').not('.nopin,.nopin img').mouseenter(function() {
            $('.pinit-wrapper').css("visibility", "hidden");
            clearTimeout(l);
            var a = $(this);
            var b = parseInt(a.css("margin-top"));
            var c = parseInt(a.css("margin-left"));
            var d;
            var e;
            switch (bs_pinButtonPos) {
                case 'center':
                    d = a.position().top + a.outerHeight(true) / 2 - n / 2;
                    e = a.position().left + a.outerWidth(true) / 2 - m / 2;
                    break;
                case 'topright':
                    d = a.position().top + b + 5;
                    e = a.position().left + c + a.outerWidth() - m - 5;
                    break;
                case 'topleft':
                    d = a.position().top + b + 5;
                    e = a.position().left + c + 5;
                    break;
                case 'bottomright':
                    d = a.position().top + b + a.outerHeight() - n - 5;
                    e = a.position().left + c + a.outerWidth() - m - 5;
                    break;
                case 'bottomleft':
                    d = a.position().top + b + a.outerHeight() - n - 5;
                    e = a.position().left + c + 5;
                    break
            }
            var f = a.prop('src');
            var g = a.closest('.post,.hentry,.entry').find('.post-title,.entry-title,.entry-header');
            var h = g.text();
            if (typeof bs_pinPrefix === 'undefined') {
                bs_pinPrefix = ''
            }
            if (typeof bs_pinSuffix === 'undefined') {
                bs_pinSuffix = ''
            }
            if (g.find('a').length) {
                pinitURL = g.find('a').attr('href').replace(/\#.+\b/gi, "")
            } else {
                pinitURL = $(location).attr('href').replace(/\#.+\b/gi, "")
            }
            var i = '<div class="pinit-wrapper" style="display:none;position: absolute;z-index: 9999; cursor: pointer;" ><a href="http://pinterest.com/pin/create/button/?url=' + pinitURL + '&media=' + f + '&description=' + bs_pinPrefix + h + bs_pinSuffix + '" style="display:block;outline:none;" target="_blank"><img class="pinimg" style="-moz-box-shadow:none;-webkit-box-shadow:none;-o-box-shadow:none;box-shadow:none;background:transparent;margin: 0;padding: 0;border:0;" src="' + bs_pinButtonURL + '" title="Pin on Pinterest" ></a></div>';
            var j = a.parent().is('a') ? a.parent() : a;
            if (!j.next().hasClass('pinit-wrapper')) {
                j.after(i);
                if (typeof l === 'undefined') {
                    j.next('.pinit-wrapper').attr("onmouseover", "this.style.opacity=1;this.style.visibility='visible'")
                } else {
                    j.next('.pinit-wrapper').attr("onmouseover", "this.style.opacity=1;this.style.visibility='visible';clearTimeout(bsButtonHover)")
                }
            }
            var k = j.next(".pinit-wrapper");
            k.css({
                "top": d,
                "left": e
            });
            k.css("visibility", "visible");
            k.stop().fadeTo(300, 1.0, function() {
                $(this).show()
            })
        });
        $('.entry-content img,.post-body img,.entry-summary img').on('mouseleave', function() {
            if ($.browser.msie) {
                var a = $(this).next('.pinit-wrapper');
                var b = $(this).parent('a').next('.pinit-wrapper');
                l = setTimeout(function() {
                    a.stop().css("visibility", "hidden");
                    b.stop().css("visibility", "hidden")
                }, 3000)
            } else {
                $('.pinit-wrapper').stop().fadeTo(1000, 0.0)
            }
        })
    }
});


		var bs_pinButtonURL = "https://lh4.googleusercontent.com/-SSTCxDhHXZc/U-dv_1S5EPI/AAAAAAAAAF4/vNbTmptFYyA/s89/pin-love-red-lowopacity.png";
		var bs_pinButtonPos = "center";
		var bs_pinPrefix = "";
		var bs_pinSuffix = "";



		var charsummy=50;
		$('.popular-posts ul li .item-snippet').each(function(){
			var txt=$(this).text().substr(0,charsummy);
			var j=txt.lastIndexOf(' ');
		if(j>10)
			$(this).text(txt.substr(0,j).replace(/[?,!\.-:;]*$/,'...'));
		});


  

$(&#39;.midnav li ul&#39;).hide().removeClass(&#39;fallback&#39;);
$(&#39;.midnav li&#39;).hover(function() {
				$(&#39;ul&#39;,this).stop().slideDown(500);},
			function() {
				$(&#39;ul&#39;,this).stop().slideUp(500);}
				);





$(&quot;img[src=&#39;http://img1.blogblog.com/img/anon36.png&#39;]&quot;)
.attr(&#39;src&#39;, &#39;https://lh5.googleusercontent.com/-djg_OaaM8to/U-MtmMNViyI/AAAAAAAAADg/SeMZF5ajXHs/s90/avatardefault.png&#39;)
.ssyby(&#39;blank&#39;)



$(&quot;img[src=&#39;http://img2.blogblog.com/img/b36-rounded.png&#39;]&quot;)
.attr(&#39;src&#39;, &#39;https://lh5.googleusercontent.com/-y8Za7Mh3K-c/U-M1XZw42GI/AAAAAAAAADw/QGsLszQ1a_A/s64/Blogger-Icon.png&#39;)
.ssyby(&#39;blank&#39;)

  
  

$(&#39;#skyelf-emoticon&#39;).css({&#39;display&#39;:&#39;none&#39;});
$(&#39;#em-btn&#39;).click(function(){
	$(&#39;#skyelf-emoticon&#39;).slideToggle(&quot;slow&quot;);
	$(&#39;#em-btn&#39;).toggleClass(&#39;closes&#39;);
	});




$(function() {
	var path = window.location.href;
	$('#midnav a').each(function() {
		if (this.href === path) {
			$(this).addClass('activin');
			}
		});
	});




jQuery(document).ready(function() {
    var offset = 220;
    var duration = 1000;
    jQuery(window).scroll(function() {
        if (jQuery(this).scrollTop() &gt; offset) {
            jQuery(&#39;.back-to-top, .totop-arrow&#39;).fadeIn(duration);
        } else {
            jQuery(&#39;.back-to-top, .totop-arrow&#39;).fadeOut(duration);
        }
    });
 
    jQuery(&#39;.back-to-top, .totop-arrow&#39;).click(function(event) {
        event.preventDefault();
        jQuery(&#39;html, body&#39;).animate({scrollTop: 0}, duration);
        return false;
    })
});
 





function showRecentPosts(json) {

    for (var i = 0; i < rp_numPosts; i++) {
        if (i == json.feed.entry.length) break;
        var entry = json.feed.entry[i],
            postTitle = entry.title.$t,
            postAuthor = entry.author[0].name.$t,
            postDate = entry.published.$t.substring(0, 10),
            postUrl,
            linkTarget,
            postContent,
            postImage,
            skeleton = "";

        var dy = postDate.substring(0, 4),
            dm = postDate.substring(5, 7),
            dd = postDate.substring(8, 10);

        for (var j = 0; j < entry.link.length; j++) {
            if (entry.link[j].rel == 'alternate') {
                postUrl = entry.link[j].href;
                break;
            }
        }

        for (var k = 0; k < entry.link.length; k++) {
            if (entry.link[k].rel == 'replies' && entry.link[k].type == 'text/html') {
                commentNum = entry.link[k].title.split(" ")[0];
                commentLabel = entry.link[k].title.split(" ")[1];
                break;
            }
        }

        if ("content" in entry) {
            postContent = entry.content.$t;
        } else if ("summary" in entry) {
            postContent = entry.summary.$t;
        } else {
            postContent = '';
        }

if (rp_thumbWidth !== 0 && rp_thumbWidth !== false) {


    
	if (i === 0) {
		rp_thumbWidth = rp_thumbWidthFirst;
	} else {
		rp_thumbWidth = rp_thumbWidthOriginal;
	}

    if ("media$thumbnail" in entry) {
        postImage = '<img style="width:' + rp_thumbWidth + 'px;height:' + rp_thumbWidth + 'px;" src="' + entry.media$thumbnail.url.replace(/\/s[0-9]+\-c/g, "\/s" + rp_thumbWidth + "-c") + '" alt="Loading..."/>';
    } else {
        postImage = '<img style="width:' + rp_thumbWidth + 'px;height:' + rp_thumbWidth + 'px;" src="' + rp_noImage + '" alt="Loading..."/>';
    }

} else {

    postImage = "";

}

        postContent = postContent.replace(/<br ?\/?>/ig, " ").replace(/<.*?>/g, "").replace(/[<>]/g, "");

        if (postContent.length > rp_numChars || rp_numChars !== false) {
            if (rp_numChars !== 0) {
                postContent = postContent.substring(0, rp_numChars) + '&hellip;';
            } else {
                postContent = '';
            }
        } else {
            postContent = '';
        }

        linkTarget = (rp_newTabLink) ? ' target="_blank"' : '';

        skeleton = '<li>';
        skeleton += '<a href="' + postUrl + '"' + linkTarget + '>' + postImage + '</a>';
        skeleton += '<a class="title" href="' + postUrl + '"' + linkTarget + '>' + postTitle + '</a>';
        skeleton += '<div class="isinya">'+ postContent + '</div>';
        skeleton += '<br style="clear:both;"/><span class="foot"><span class="dt">' + rp_monthNames[parseInt(dm, 10) - 1] + ' ' + dd + ' ,' + ' '+ dy + '</span> <span class="cm">(' + commentNum + ' ' + commentLabel + ')</span></span>';
        skeleton += '</li>';
        document.getElementById('dte_recent-post').innerHTML += skeleton;
    }

}

var labelName = (rp_sortByLabel !== false) ? '-/' + rp_sortByLabel : "";
var rp_script = document.createElement('script');
rp_script.src = rp_homePage + '/feeds/posts/summary/' + labelName + '?alt=json-in-script&callback=showRecentPosts';

// Preloading...
if (rp_loadTimer === "onload") {
    window.onload = function() {
        document.getElementsByTagName('head')[0].appendChild(rp_script);
    };
} else {
    setTimeout(function() {
        document.getElementsByTagName('head')[0].appendChild(rp_script);
    }, rp_loadTimer);
}
